Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@remote-ui/types
Advanced tools
This library provides a couple of utility types used in other remote-ui libraries. All of these types are re-exported from [`@remote-ui/core`](../core).
@remote-ui/types
This library provides a couple of utility types used in other remote-ui libraries. All of these types are re-exported from @remote-ui/core
.
RemoteComponentType<Type, Props, AllowedChildren>
A “type” in remote-ui is represented with a humble string. You pass a string to RemoteRoot#createComponent](../core#remoterootcreatecomponent) in order to create a new component instance, and a string identifier for the component is the only required argument. However, many of the remote-ui libraries have support for a more strongly-typed version of that string, which is the purpose of
RemoteComponentType. This type is still “just a string”, but includes additional type parameters for the type of the properties allowed for that component, and for the types of components this component accepts as children. The [
RemoteComponent` APIs, as well as a number of others, use these types to offer you editor autocompletion on property names, and other helpful type checking.
The AllowedChildren
argument does not perform any runtime validation, it only provides compile-time checking to ensure value children are appended to a component. If your component accepts any child, including being able to accept text nodes as children, you can pass true
for this type parameter (or leave it unset, as the default is true
).
IdentifierForRemoteComponent<Type>
If the Type
parameter is a RemoteComponentType
, this will extract the exact string type that is that component’s unique name.
type Button = RemoteComponent<'Button', {onPress(): void}>;
type ButtonType = IdentifierForRemoteComponent<Button>; // 'Button'
PropsForRemoteComponent<Type>
If the Type
parameter is a RemoteComponentType
, this will extract the props type for that component
type Button = RemoteComponent<'Button', {onPress(): void}>;
type ButtonType = PropsForRemoteComponent<Button>; // {onPress(): void}
FAQs
This library provides a couple of utility types used in other remote-ui libraries. All of these types are re-exported from [`@remote-ui/core`](../core).
The npm package @remote-ui/types receives a total of 30,725 weekly downloads. As such, @remote-ui/types popularity was classified as popular.
We found that @remote-ui/types demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.